package cz.proks.schoolpupilbook.gwt.core;

import java.util.Date;
import java.util.LinkedList;

import cz.proks.schoolpupilbook.shared.domain.Course;
import cz.proks.schoolpupilbook.shared.domain.Mark;
import cz.proks.schoolpupilbook.shared.domain.User;
import cz.proks.schoolpupilbook.shared.domain.User.Role;
import cz.proks.schoolpupilbook.shared.domain.UserCourseRelation;
import cz.proks.schoolpupilbook.shared.domain.UserRelation;

public class Test {	
	public static class MockUser {
		public static final User user1 = new User("1", "Name1", "Surrname1", Role.STUDENT, "user1", "user1"); 
		public static final User user2 = new User("2", "Name2", "Surrname2", Role.STUDENT, "user2", "user2");
		public static final User user3 = new User("3", "Name3", "Surrname3", Role.STUDENT, "user3", "user3");
		
		public static final User user4 = new User("4", "Name4", "Surrname4", Role.PARENT, "user4", "user4"); 
		public static final User user5 = new User("5", "Name5", "Surrname5", Role.PARENT, "user5", "user5");
		
		public static final User user6 = new User("6", "Name6", "Surrname6", Role.LECTOR, "user6", "user6"); 
		public static final User user7 = new User("7", "Name7", "Surrname7", Role.LECTOR, "user7", "user7");
	}
	
	public static class MockCourse {
		public static final Course course1 = new Course("1", "CCode1", "Course1"); 
		public static final Course course2 = new Course("2", "CCode2", "Course2");
		public static final Course course3 = new Course("3", "CCode3", "Course3");
		public static final Course course4 = new Course("4", "CCode4", "Course4");
		public static final Course course5 = new Course("5", "CCode5", "Course5");		
	}
	
	public static class MockMark {
		public static final Mark mark1 = new Mark("1", MockUser.user6, MockUser.user1, MockCourse.course1, new Date(), "1");
		public static final Mark mark2 = new Mark("2", MockUser.user7, MockUser.user1, MockCourse.course2, new Date(), "2");
		public static final Mark mark3 = new Mark("3", MockUser.user6, MockUser.user1, MockCourse.course2, new Date(), "3");
		public static final Mark mark4 = new Mark("4", MockUser.user7, MockUser.user1, MockCourse.course1, new Date(), "4");
		public static final Mark mark5 = new Mark("5", MockUser.user6, MockUser.user1, MockCourse.course2, new Date(), "5");
		public static final Mark mark6 = new Mark("6", MockUser.user7, MockUser.user2, MockCourse.course3, new Date(), "1");
		public static final Mark mark7 = new Mark("7", MockUser.user6, MockUser.user2, MockCourse.course3, new Date(), "2");
		public static final Mark mark8 = new Mark("8", MockUser.user7, MockUser.user2, MockCourse.course2, new Date(), "3");
		public static final Mark mark9 = new Mark("9", MockUser.user6, MockUser.user2, MockCourse.course3, new Date(), "4");
		public static final Mark mark10 = new Mark("10", MockUser.user7, MockUser.user2, MockCourse.course3, new Date(), "5");
		public static final Mark mark11 = new Mark("11", MockUser.user6, MockUser.user3, MockCourse.course2, new Date(), "1");
		public static final Mark mark12 = new Mark("12", MockUser.user7, MockUser.user3, MockCourse.course2, new Date(), "2");
		public static final Mark mark13 = new Mark("13", MockUser.user6, MockUser.user3, MockCourse.course2, new Date(), "3");
		
		static {
			mark1.addComment(MockUser.user4, new Date(), "TestComment1");
			mark2.addComment(MockUser.user4, new Date(), "TestComment2");
			mark3.addComment(MockUser.user4, new Date(), "TestComment3");
			mark4.addComment(MockUser.user4, new Date(), "TestComment4");
			mark5.addComment(MockUser.user4, new Date(), "TestComment5");
			mark6.addComment(MockUser.user5, new Date(), "TestComment6");
			mark7.addComment(MockUser.user5, new Date(), "TestComment7");
			mark8.addComment(MockUser.user5, new Date(), "TestComment8");
			mark9.addComment(MockUser.user5, new Date(), "TestComment9");
			mark10.addComment(MockUser.user5, new Date(), "TestComment10");
			mark11.addComment(MockUser.user5, new Date(), "TestComment11");
			mark12.addComment(MockUser.user4, new Date(), "TestComment12");
			mark13.addComment(MockUser.user4, new Date(), "TestComment13");
			mark1.addComment(MockUser.user6, new Date(), "TestComment14");
			mark2.addComment(MockUser.user7, new Date(), "TestComment15");
			mark3.addComment(MockUser.user6, new Date(), "TestComment16");
			mark4.addComment(MockUser.user7, new Date(), "TestComment17");
			mark5.addComment(MockUser.user6, new Date(), "TestComment18");
			mark6.addComment(MockUser.user7, new Date(), "TestComment19");
			mark7.addComment(MockUser.user6, new Date(), "TestComment20");
			mark8.addComment(MockUser.user7, new Date(), "TestComment21");
			mark9.addComment(MockUser.user6, new Date(), "TestComment22");
		}
	}
	
	public static class MockUserRelation {
		public static final UserRelation userRelation1 = new UserRelation("1", MockUser.user4, MockUser.user1);
		public static final UserRelation userRelation2 = new UserRelation("2", MockUser.user5, MockUser.user2);
		public static final UserRelation userRelation3 = new UserRelation("3", MockUser.user4, MockUser.user3);			
	}
	
	public static class MockUserCourseRelation {
		public static final UserCourseRelation userCourseRelation1 = new UserCourseRelation("1", MockUser.user1, MockCourse.course1);
		public static final UserCourseRelation userCourseRelation2 = new UserCourseRelation("2", MockUser.user1, MockCourse.course2);
		public static final UserCourseRelation userCourseRelation3 = new UserCourseRelation("3", MockUser.user2, MockCourse.course2);
		public static final UserCourseRelation userCourseRelation4 = new UserCourseRelation("4", MockUser.user2, MockCourse.course3);
		public static final UserCourseRelation userCourseRelation5 = new UserCourseRelation("5", MockUser.user3, MockCourse.course2);		
	}
	
	public static LinkedList<User> users = new LinkedList<User>();
	public static LinkedList<Course> courses = new LinkedList<Course>();
	public static LinkedList<Mark> marks = new LinkedList<Mark>();
	public static LinkedList<UserRelation> userRelations = new LinkedList<UserRelation>();
	public static LinkedList<UserCourseRelation> userCourseRelations = new LinkedList<UserCourseRelation>();
	
	static {
		users.add(MockUser.user1); users.add(MockUser.user2); users.add(MockUser.user3);
		users.add(MockUser.user4); users.add(MockUser.user5); users.add(MockUser.user6);
		users.add(MockUser.user7);
		
		courses.add(MockCourse.course1); courses.add(MockCourse.course2); courses.add(MockCourse.course3);
		courses.add(MockCourse.course4); courses.add(MockCourse.course5);
		
		marks.add(MockMark.mark1); marks.add(MockMark.mark2); marks.add(MockMark.mark3); marks.add(MockMark.mark4);
		marks.add(MockMark.mark5); marks.add(MockMark.mark6); marks.add(MockMark.mark7); marks.add(MockMark.mark8);
		marks.add(MockMark.mark9); marks.add(MockMark.mark10); marks.add(MockMark.mark11); marks.add(MockMark.mark12);
		marks.add(MockMark.mark13);
		
		userRelations.add(MockUserRelation.userRelation1); userRelations.add(MockUserRelation.userRelation2);
		userRelations.add(MockUserRelation.userRelation3);
		
		userCourseRelations.add(MockUserCourseRelation.userCourseRelation1); userCourseRelations.add(MockUserCourseRelation.userCourseRelation2);
		userCourseRelations.add(MockUserCourseRelation.userCourseRelation3); userCourseRelations.add(MockUserCourseRelation.userCourseRelation4);
		userCourseRelations.add(MockUserCourseRelation.userCourseRelation5);
	}
			
}
